package config

import (
	"gopkg.in/yaml.v3"
	"os"
)

type Config struct {
	ParserType string         `yaml:"parserType"`
	EventBus   EventBusConfig `yaml:"eventBus"`
}

type EventBusConfig struct {
	Type string `yaml:"type"`
}

func LoadConfigFromYamlFile(filePath string) (*Config, error) {
	data, err := os.ReadFile(filePath)
	if err != nil {
		return nil, err
	}

	var cfg Config
	err = yaml.Unmarshal(data, &cfg)
	if err != nil {
		return nil, err
	}

	return &cfg, nil
}
